package com.example.shop.merchant.config;

import com.example.shop.merchant.listener.MerchantSessionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MerchantSessionConfig {
    @Autowired
    MerchantSessionListener merchantSessionListener;

    @Bean
    public ServletListenerRegistrationBean<MerchantSessionListener> ServletListenerRegistrationBean(){
        ServletListenerRegistrationBean<MerchantSessionListener> listenerRegister = new ServletListenerRegistrationBean<>();
        listenerRegister.setListener(merchantSessionListener);
        return listenerRegister;
    }
}
